ImageGear Professional v18.2 > User Guide > Using ImageGear > Scanning Images > Scanning Images Using the TWAIN Interface > Using ImageGear TWAIN API for Scanning Images > Setting the TWAIN Image Acquisition Mode |
There are three acquisition modes in TWAIN:
Remember that not all of the TWAIN-supported transfer syntax modes are supported by all Data Sources. If you try to use an acquisition mode that your device does not support, you will receive an error message. |
Tell ImageGear the transfer mode to use with the function IG_TWAIN_cap_set().
Copy Code
|
|
---|---|
HTWAINCAP hTWAINCap = (HTWAINCAP)NULL;
DWORD dwXferMode = IG_TW_SX_FILE;
nErrCount = IG_TWAIN_cap_create(IG_TW_ICAP_XFERMECH, IG_TW_ON_ONEVALUE,
AM_TID_META_UINT16, &hTWAINCap);
nErrCount = IG_TWAIN_cap_value_set(hTWAINCap, (LPCVOID)dwXferMode,
sizeof(dwXferMode));
nErrCount = IG_TWAIN_cap_set(hTWAINCap, IG_TW_MSG_SET);
IG_TWAIN_cap_delete(hTWAINCap);
|
Copy Code
|
|
---|---|
HTWAINCAP hTWAINCap = (HTWAINCAP)NULL;
DWORD dwXferMode = IG_TW_SX_MEMORY;
nErrCount = IG_TWAIN_cap_create(IG_TW_ICAP_XFERMECH, IG_TW_ON_ONEVALUE,
AM_TID_META_UINT16, &hTWAINCap);
nErrCount = IG_TWAIN_cap_value_set(hTWAINCap, (LPCVOID)dwXferMode,
sizeof(dwXferMode));
nErrCount = IG_TWAIN_cap_set(hTWAINCap, IG_TW_MSG_SET);
IG_TWAIN_cap_delete(hTWAINCap);
|
Copy Code
|
|
---|---|
HTWAINCAP hTWAINCap = (HTWAINCAP)NULL;
DWORD dwXferMode = IG_TW_SX_NATIVE;
nErrCount = IG_TWAIN_cap_create(IG_TW_ICAP_XFERMECH, IG_TW_ON_ONEVALUE,
AM_TID_META_UINT16, &hTWAINCap);
nErrCount = IG_TWAIN_cap_value_set(hTWAINCap, (LPCVOID)dwXferMode,
sizeof(dwXferMode));
nErrCount = IG_TWAIN_cap_set(hTWAINCap, IG_TW_MSG_SET);
IG_TWAIN_cap_delete(hTWAINCap);
|
By default, if no call is made to set transfer mode, ImageGear will use the mode set in Data Source.